﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MasterPage.Master" Inherits="System.Web.Mvc.ViewPage<AnalisisDeRiesgos.Models.Area.EditAreaModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Editar Area
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#Management").change(function () {
                $.getJSON("/Area/GetProcessByManagementId/" + $("#Management > option:selected").attr("value"), function (data) {
                    var items = "";
                    $.each(data, function (i, state) {
                        items += "<option value='" + state.Value + "'>" + state.Text + "</option>";
                    });
                    $("#Process").html(items);
                });
            });
        });
    </script>
    <h2>Editar</h2>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>
        
        <fieldset>
            <legend>Campos</legend>
            
            <div class="editor-field">
                <%: Html.HiddenFor(model => model.AreaId) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Name) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Name) %>
                <%: Html.ValidationMessageFor(model => model.Name) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Management) %>
            </div>
            <div class="editor-field">
                <%: Html.DropDownListFor(model => model.Management, Model.Managements)%>
                <%: Html.ValidationMessageFor(model => model.Management) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Process) %>
            </div>
            <div class="editor-field">
                <%: Html.DropDownListFor(model => model.Process, Model.Processes) %>
                <%: Html.ValidationMessageFor(model => model.Process) %>
            </div>
            
            <p>
                <input type="submit" value="Guardar" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%: Html.ActionLink("Regresar a la lista", "Index") %>
    </div>

</asp:Content>

